/**
 * Copyright (c) 2015 www.smarthome.com All rights reserved. <br />
 * 本软件源代码版权归xxxx公司,未经许可不得任意复制与传播.<br />
 *
 */
package com.smarthome.core.deviceManager.impl;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.springframework.stereotype.Service;

import com.smarthome.base.service.ShEquipmentDdnsService;
import com.smarthome.core.deviceManager.EquipmentDdnsService;
import com.smarthome.domain.bean.ShEquipmentDdns;
import com.smarthome.domain.bean.ShEquipmentUser;
import com.smarthome.domain.vo.api.UserDeviceBean;
import com.smarthome.domain.vo.boss.DataGrid;
import com.smarthome.domain.vo.boss.PageHelper;

/**
 * ddns的服务类
 * 
 * @author shazhichao
 *
 */
@Service("equipmentDdnsService")
public class EquipmentDdnsServiceImpl implements EquipmentDdnsService {

    protected static Logger LOGGER;

    @Resource
    private ShEquipmentDdnsService shEquipmentDdnsService;
    

    /**
	 * 查询dns列表--翻页page
	 * @param deviceSupplier
	 * @param page
	 * @return
	 */
    @Override
    public DataGrid getDataGrid(ShEquipmentDdns equipmentDdns, PageHelper page) {
        return shEquipmentDdnsService.queryShEquipmentDdnsPage(equipmentDdns, page);
    }

    /**
     * 新增数据
     */
    @Override
	public int add(ShEquipmentDdns equipmentDdns) {
    	return shEquipmentDdnsService.saveOrUpdate(equipmentDdns);
	}
    
    /**
     * 通过id主键，得到对象信息
     */
    @Override
	public ShEquipmentDdns queryEquipmentDdnsById(Long id) {
		return shEquipmentDdnsService.selectEntryById(id);
	}
    
    /**
     * 修改
     */
    @Override
	public int edit(ShEquipmentDdns equipmentDdns) {
    	return shEquipmentDdnsService.saveOrUpdate(equipmentDdns);
	}

    /**
     * 删除
     */
	@Override
	public int delte(Long id) {
		List<Long> ids = new ArrayList<Long>();
		ids.add(id);
		return shEquipmentDdnsService.deleteByIds(ids.toArray(new Long[ids.size()]));
	}
	
	/**
	 * 得到信息list
	 * @param equipmentInfo
	 * @return
	 */
	public List<ShEquipmentDdns> shShEquipmentDdns(ShEquipmentDdns equipmentDdns){
		return shEquipmentDdnsService.selectEntryList(equipmentDdns);
	}
	

	
}
